import { createRouter,createWebHistory,RouteRecordRaw } from 'vue-router';
import Layout from '../layout/index.vue'

export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: '/dashboard',
        component: () => import('@/layout/dashboard/Index.vue'),
        name: 'dashboard',
        meta: {
          title: '首页',
          icon: '#icondashboard'
        }
      }
    ]
  },
  {
    path: '/login',
    name:'login',
    component: () => import('@/views/login/login.vue'),
  },
  {
    path: '/hello',
    name:'hello',
    component: () => import('@/components/TestDialog.vue'),
  },
  {
    path: '/department/detail',
    component: Layout,
    redirect: '/department/detail/:id',
    children: [
      {
        path: '/department/detail/:id',
        component: () => import('@/views/system/department/detail.vue'),
        name: 'departmentDeatil',
        meta: {
          title: '部门详情',
          icon: '#icondashboard',
          hidden: true,
        }
      }
    ]
  }
]

const router = createRouter({
  history:createWebHistory(),
  routes:constantRoutes
})
export default router